package com.project.web.controller.api;

import com.project.client.service.CentigradeRecordService;
import com.project.common.core.controller.BaseController;
import com.project.common.core.domain.Result;
import com.project.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Date;

/**
 * 温度记录数据Controller
 *
 * @author project
 * @date 2021-05-10
 */
@RestController
@RequestMapping("api/centigrade")
public class ClientCentigradeRecordController extends BaseController {
    @Autowired
    private CentigradeRecordService service;

    //获取温度数据
    @GetMapping("/find")
    public Result find(@RequestParam String areaKey) {
        return Result.success(service.findClientData(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD, new Date()), areaKey));
    }

}